using System;
using System.Collections.Generic;
using System.Text;
using Danser_Entity.Entities;
namespace Danser_Control.Managers
{
    /// <summary>
    /// Handle Danser's authorization and permissions mechanism
    /// </summary>
    public interface IUserManager
    {
        /// <summary>
        /// Checks foran existing user in DB
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        bool IsUserExists(string userID);

        /// <summary>
        /// Gets the user's permission if exists.
        /// Also will throw something like UserNotFOundException 
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        PermissionLevel GetUserPermission(string userID);

        /// <summary>
        /// Gets all user entities according to the selected ids 
        /// </summary>
        /// <param name="userIDs">list of selected ids. if null or empty - will retrieve all users in DB</param>
        /// <returns>List of users</returns>
        IList<User> GetUsers(IList<string> userIDs);

        /// <summary>
        /// Gets all user entities satisfying the given condition 
        /// </summary>
        /// <param name="filter">SQL sentence for WHERE clause </param>
        /// <returns>List of users</returns>
        IList<User> GetUsers(String filter);

        /// <summary>
        /// Adds user to DB
        /// Also will throw something like UserNotFOundException
        /// Important - must enrich the entity with the last parameter userName
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="permissionLevel"></param>
        /// <exception cref="Danser_Control.Exceptions.DanserAuthorizationException"></exception>
        void AddUser(string userID, PermissionLevel permissionLevel);

        /// <summary>
        /// Removes user from DB
        /// Also will throw something like UserNotFOundException 
        /// </summary>
        /// <param name="userID"></param>
        void RemoveUser(string userID);
        
        /// <summary>
        /// modifies the selected user's permission level
        /// Also will throw something like UserNotFOundException 
        /// </summary>
        /// <param name="userID">The id of the user to be modified</param>
        /// <param name="permissionLevel"></param>
        /// <exception cref="Danser_Control.Exceptions.DanserAuthorizationException"></exception>
        void ModifyPermission(string userID, PermissionLevel permissionLevel);
      
    }
}
